Spread Windows Forms 6.0 Product Documentation
SetCalendarText(String[],String[],String[],String[],String,String,String) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > DateTimeCellType Class > SetCalendarText Method : SetCalendarText(String[],String[],String[],String[],String,String,String) Method


dayNames
Set of day names
monthNames
Set of month names
shortdayNames
Set of abbreviated day names
shortmonthNames
Set of abbreviated month names
okText
Text for the OK button
cancelText
Text for the Cancel button
currentText
Text for the Today button or Now button

Glossary Item Box

Sets the various text elements for the pop-up calendar, including the day and month names, the today text, and the button text.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub SetCalendarText( _
   ByVal dayNames() As String, _
   ByVal monthNames() As String, _
   ByVal shortdayNames() As String, _
   ByVal shortmonthNames() As String, _
   ByVal okText As String, _
   ByVal cancelText As String, _
   ByVal currentText As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As DateTimeCellType
Dim dayNames() As String
Dim monthNames() As String
Dim shortdayNames() As String
Dim shortmonthNames() As String
Dim okText As String
Dim cancelText As String
Dim currentText As String
 
instance.SetCalendarText(dayNames, monthNames, shortdayNames, shortmonthNames, okText, cancelText, currentText)
C# 
public void SetCalendarText( 
   string[] dayNames,
   string[] monthNames,
   string[] shortdayNames,
   string[] shortmonthNames,
   string okText,
   string cancelText,
   string currentText
)

Parameters

dayNames
Set of day names
monthNames
Set of month names
shortdayNames
Set of abbreviated day names
shortmonthNames
Set of abbreviated month names
okText
Text for the OK button
cancelText
Text for the Cancel button
currentText
Text for the Today button or Now button

Remarks

The four string arrays for names set the names for the ddd, dddd, MMM and MMMM formats when used in the DateTimeCellType's editor. If any of the four string arrays for names are null, the calendar displays using the values set in the DateTimeCellType's properties. If those are null, the system names are used.

The various text parameters determine the text that appears in the buttons at the bottom of the calendar control. For all but the TimeOnly setting, the buttons appear on the calendar control. The currentText contains the text for the Today button.

Pop-up Calendar Buttons

For the TimeOnly setting, a clock control appears and the currentText contains the text for the Now button.

Pop-up Clock Buttons

Be aware that this method sets the calendar text only for an individual cell, so different cells can have different calendar text within the same Spread component.

For more information on the one-dimensional string array containing the names of the months, refer to MonthNames topic in the Microsoft .NET Framework documentation.

Example

This example sets the text for the calendar.
C#Copy Code
FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType();
dt.SetCalendarText(new String[] {"Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"}, new String[] {"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}, new String[] {"S", "M", "T", "W", "Th", "F", "Sa"}, new String[]
{"J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"}, "Finished", "Later", "Now"); dt.SetCalendarFormat("MM/dd/yyyy");
fpSpread1.ActiveSheet.Cells[0, 0].CellType = dt;
Visual BasicCopy Code
Dim dt As New FarPoint.Win.Spread.CellType.DateTimeCellType
dt.SetCalendarText(New String() {"Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"}, New String() {"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}, New String() {"S", "M", "T", "W", "Th", "F", "Sa"}, New String()
{"J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"}, "Finished", "Later", "Now")
dt.SetCalendarFormat("MM/dd/yyyy")
FpSpread1.ActiveSheet.Cells(0, 0).CellType = dt

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.